%b00(x)u0''+h00(x)u0'+b10(x)u1''+h10(x)u1'+b20(x)u''+h20u'+b30u''+h30u'=f0
%with Dirichlet boundary 
clear all

%construct mesh
n=4000; term=4;  sig=0.1; type='determ';%type='naive';
% unimesh=(0:1/n:1)';

theeijk(sig);    thebjk(term,type);     thehjk(term,type);     

A=matA(n,term);
if(size(A,1)==0)
    disp('too high')
else
    
%construct source f
b=srcf(n,term,type);

%solve the equation
u=A\b;
clear A b;

%measure the error
%  utmp=[u0ex(unimesh(2:n));u1ex(unimesh(2:n));u2ex(unimesh(2:n));u3ex(unimesh(2:n))];
%  uex=utmp(1:term*(n-1));
%  err=max(abs(uex-u))


%uex=uexact(n,term);
%err=L2error(uex,u)

if(strcmp(type,'naive'))
    err=maxL2err(u,term,'max');
else
    err=maxL2err(u,term,'L2');
end
disp(err)
end